<?php $options = array('red'=> 'red', 'yellow' => 'yellow', 'green' => 'green'); ?>
<h3>Change Status Messages For This Applicant</h3>
<?php echo $this->Form->create('Application', array('action' => 'modifyStatus', $this->data['Application']['id'])); ?>
<?php echo $this->Form->input('id'); ?>
	<fieldset><legend> Personal Information</legend>
	<div class="input">
	<p> Current Status:
	<?php echo render_status($this->data['Application']['pif_stat'], $this->Html); ?>
	</p>
	</div>
	<?php echo $this->Form->input('pif_stat', array('label' => 'New Status', 'options' => $options)); ?>
	<?php echo $this->Form->input('pif_msg', array('label' => 'Status Message')); ?>
	</fieldset>
	<fieldset><legend> Study/Research Information</legend>
	<div class="input">
	<p> Current Status:
	<?php echo render_status($this->data['Application']['studyinterest_stat'], $this->Html); ?>
	</p>
	</div>
	<?php echo $this->Form->input('studyinterest_stat', array('label' => 'New Status', 'options' => $options)); ?>
	<?php echo $this->Form->input('studyinterest_msg', array('label' => 'Status Message')); ?>
	</fieldset>
	<fieldset><legend> Educational History Information</legend>
	<div class="input">
	<p> Current Status:
	<?php echo render_status($this->data['Application']['edhistory_stat'], $this->Html); ?>
	</p>
	</div>
	<?php echo $this->Form->input('edhistory_stat', array('label' => 'New Status', 'options' => $options)); ?>
	<?php echo $this->Form->input('edhistory_msg', array('label' => 'Status Message')); ?>
	</fieldset>
	<fieldset><legend> Course/Grade Information</legend>
	<div class="input">
	<p> Current Status:
	<?php echo render_status($this->data['Application']['courses_stat'], $this->Html); ?>
	</p>
	</div>
	<?php echo $this->Form->input('courses_stat', array('label' => 'New Status', 'options' => $options)); ?>
	<?php echo $this->Form->input('courses_msg', array('label' => 'Status Message')); ?>
	</fieldset>
	<fieldset><legend> References Information</legend>
	<div class="input">
	<p> Current Status:
	<?php echo render_status($this->data['Application']['references_stat'], $this->Html); ?>
	</p>
	</div>
	<?php echo $this->Form->input('references_stat', array('label' => 'New Status', 'options' => $options)); ?>
	<?php echo $this->Form->input('references_msg', array('label' => 'Status Message')); ?>
	</fieldset>
	<fieldset><legend> Additional Qualifications Information</legend>
	<div class="input">
	<p> Current Status:
	<?php echo render_status($this->data['Application']['depth_stat'], $this->Html); ?>
	</p>
	</div>
	<?php echo $this->Form->input('depth_stat', array('label' => 'New Status', 'options' => $options)); ?>
	<?php echo $this->Form->input('depth_msg', array('label' => 'Status Message')); ?>
	</fieldset>
	<fieldset><legend> Personal Statement Information</legend>
	<div class="input">
	<p> Current Status:
	<?php echo render_status($this->data['Application']['pstatement_stat'], $this->Html); ?>
	</p>
	</div>
	<?php echo $this->Form->input('pstatement_stat', array('label' => 'New Status', 'options' => $options)); ?>
	<?php echo $this->Form->input('pstatement_msg', array('label' => 'Status Message')); ?>
	</fieldset>
	<fieldset><legend> Writing Sample Information</legend>
	<div class="input">
	<p> Current Status:
	<?php echo render_status($this->data['Application']['wsample_stat'], $this->Html); ?>
	</p>
	</div>
	<?php echo $this->Form->input('wsample_stat', array('label' => 'New Status', 'options' => $options)); ?>
	<?php echo $this->Form->input('wsample_msg', array('label' => 'Status Message')); ?>
	</fieldset>
	<fieldset><legend> Transcripts Information</legend>
	<div class="input">
	<p> Current Status:
	<?php echo render_status($this->data['Application']['transcripts_stat'], $this->Html); ?>
	</p>
	</div>
	<?php echo $this->Form->input('transcripts_stat', array('label' => 'New Status', 'options' => $options)); ?>
	<?php echo $this->Form->input('transcripts_msg', array('label' => 'Status Message')); ?>
	</fieldset>
	<fieldset><legend> GRE Information</legend>
	<div class="input">
	<p> Current Status:
	<?php echo render_status($this->data['Application']['gre_stat'], $this->Html); ?>
	</p>
	</div>
	<?php echo $this->Form->input('gre_stat', array('label' => 'New Status', 'options' => $options)); ?>
	<?php echo $this->Form->input('gre_msg', array('label' => 'Status Message')); ?>
	</fieldset>
	<?php echo $this->Form->input('toefl_req', array('type' => 'hidden')); ?>
	<?php if($this->data['Application']['toefl_req']) {?>
		<fieldset><legend> TOEFL Information</legend>
		<div class="input">
		<p> Current Status:
		<?php echo render_status($this->data['Application']['toefl_stat'], $this->Html); ?>
		</p>
		</div>
		<?php echo $this->Form->input('toefl_stat', array('label' => 'New Status', 'options' => $options)); ?>
		<?php echo $this->Form->input('toefl_msg', array('label' => 'Status Message')); ?>
		</fieldset>
	<?php } //end if Toefl ?>
	<fieldset><legend> Application Complete</legend>
	<label for="Application/complete"> This Application is currently complete. </label>
	<?php echo $this->Form->input('complete', array('type' => 'checkbox', 'label' => '')); ?>
	</fieldset>
	<?php echo $this->Form->end('Save'); ?>
<?php
	
function render_status($status, $html) {
	switch ($status) {
		case 'red': 
			return $html->image('redlight_yb.jpg', array('alt' => 'No Submission'));
			break;
		case 'yellow':
			return $html->image('yellowlight_yb.jpg', array('alt' => 'Incomplete'));
			break;
		case 'green':
			return $html->image('greenlight_yb.jpg', array('alt' => 'Complete'));
			break;
	}
}

?>